home *** CD-ROM | disk | FTP | other *** search
- SERVICE: COMMAND KEY: H
-
- ' Make sure there's a modem file
-
- IF (@modemFile = "") OR (NOT Exists%(ServiceFPath & @modemFile)) THEN ∂
-
- GOSUB getModemFile
-
- ' Log off if service was set
-
- IF Service <> "" THEN DOLOGOFF:IF ResultCode% = 0 THEN END
-
- ' If log off succeeds then end, else hang up
-
- DO FILE @modemFile "hangUp"
-
- IF ResultCode% <> 0 THEN ∂
-
- badFile = @modemFile: ∂
-
- badLabel = "HangUp": ∂
-
- GOSUB doFileError: ∂
-
- END
-
- IF Remark = "" THEN Remark = "MiniTerminal"
-
- JOURNALIZE
-
- Remark = ""
-
- TIMER RESET
-
- END
-
-
-
- getModemFile: 'gets name of modem file and stores it in variable @modemFile
-
- prompt1 = "You are attempting to hang up without a modem file. Please find the modem file."
-
- getModemFile2:
-
- fileType1 = "SERV"
-
- HOLD OFF
-
- modemFile = GetFile(prompt1,fileType1,ServiceFPath)
-
- IF (ResultCode% = 100) OR (DBoxResult% = CANCEL%) THEN END ' user gave up, end
-
- HOLD ON
-
- CURSOR WATCH
-
- 'parse the path from string returned by GetFile
-
- myPath = modemFile
-
- lastColon% = 0
-
- getLastColon: ' find the last colon before the file name
-
- IF InStr%(lastColon%+1, myPath, ":") <> 0 THEN ∂
-
- lastColon% = lastColon%+1: GOTO getLastColon
-
- myPath = Left(myPath,lastColon%)
-
- modemFile = Mid(modemFile, lastColon%+1) ' modemFile is now file name
-
- ServiceFPath = myPath ' set ServiceFPath to path returned by GetFile
-
- Message = "" ' "Identify" sets message
-
- DO FILE modemFile "Identify"
-
- IF (ResultCode% <> 0) THEN ∂
-
- IF (ResultCode% <> 106) THEN ∂ ' bad label error
-
- badFile = modemFile: ∂ ' 106 is "label not found" error
-
- badLabel = "Identify": ∂
-
- GOSUB doFileError: ∂
-
- CURSOR RESET: ∂
-
- END ∂
-
- ELSE Message = "NotModem" ' coerce dbox for error #106
-
- IF UpCase(Message) <> "MODEM" THEN ∂ ' modemFile is not a modem file
-
- DBoxSay = modemFile & " does not appear to be a modem file. " & ∂
-
- "This program cannot hang up without a modem file. " & ∂
-
- "An example of a modem file for Apple and " & ∂
-
- "Hayes-compatible modems is ""Hayes Modem."" Try again?": ∂
-
- HOLD OFF: ∂
-
- DBOX 2: ∂
-
- IF DBoxResult% = OK% THEN HOLD ON:GOTO getModemFile ∂
-
- ELSE END ' user gave up, end
-
- ' check to see if modem file in Lookup Table is still there
-
- IF @modemFile <> "" THEN ∂
-
- IF NOT Exists%(ServiceFPath & @modemFile) THEN CLEAR @modemFile ∂
-
- ELSE ∂
-
- DO FILE @modemFile "ClearTable": ∂
-
- IF ResultCode% <> 0 THEN ∂ ' check for "DO FILE" error
-
- badFile = @modemFile: ∂
-
- badLabel = "ClearTable": ∂
-
- GOSUB doFileError: ∂
-
- END
-
- @modemFile = modemFile ' put modem file in lookup table
-
- RETURN
-
-
-
- doFIleError: ' puts up error dialog and aborts
-
-
-
- HOLD OFF
-
- BELL:BELL ' alert user
-
- ' Give user a description of error
-
- IF ResultCode% = 106 THEN DBoxSay = "Cannot find the label """ & badLabel & ∂
-
- """ in the file """ & badFile & """. Program aborted." ∂
-
- ELSE IF ResultCode% = -108 THEN ∂
-
- DBoxSay = "Not enough memory to open the file """ & ∂
-
- badFile & """. Program aborted." ∂
-
- ELSE IF ResultCode% = -35 THEN ∂
-
- DBoxSay = "Cannot open the file """ & badFile & ∂
-
- """ because volume specified doesn't exist. Program aborted." ∂
-
- ELSE IF ResultCode% = -49 THEN ∂
-
- DBoxSay = "Cannot open the file """ & badFile & ∂
-
- """ because it is already open for writing. Program aborted." ∂
-
- ELSE IF ResultCode% = -47 THEN ∂
-
- DBoxSay = "Cannot open the file """ & badFile & ∂
-
- """ because it is busy. Program aborted." ∂
-
- ELSE DBoxSay = "The following error occurred during a call to """ & badLabel & ∂
-
- """ in the file """ & badFile & """: Macintosh error result code = " & ∂
-
- ResultCode% & ". Program aborted."
-
- DBOX 1
-
- RETURN
-
-
-
- Interrupt:
-
- DISPLAY "^M^JWait for hang up to finish."
-
- RETURN
-
-